package com.jeesite.modules.information.entity; // 请替换为您的实际包路径

import com.fasterxml.jackson.annotation.JsonFormat;
import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 店铺订单Entity
 *
 * @author YourName
 * @version 2025-10-09
 */
@Table(name = "cere_shop_order", alias = "a", label = "店铺订单信息", columns = {
        @Column(name = "order_id", attrName = "id", label = "订单ID", isPK = true),
        @Column(name = "parent_id", attrName = "parentId", label = "父订单ID"),
        @Column(name = "shop_id", attrName = "shopId", label = "店铺ID"),
        @Column(name = "product_id", attrName = "productId", label = "商品ID"),
        @Column(name = "order_formid", attrName = "orderFormid", label = "订单来源"),
        @Column(name = "buyer_user_id", attrName = "buyerUserId", label = "购买用户ID"),
        @Column(name = "price", attrName = "price", label = "订单价格"),
        @Column(name = "state", attrName = "state", label = "订单状态"),
        @Column(name = "create_time", attrName = "createTime", label = "下单时间", isQuery = false),
}, orderBy = "a.create_time DESC"
)
public class CereShopOrder extends DataEntity<CereShopOrder> {

    private static final long serialVersionUID = 1L;
    private Long parentId;          // 父订单ID
    private Long shopId;            // 店铺ID
    private Long productId;         // 商品ID
    private String orderFormid;     // 订单来源
    private Long buyerUserId;       // 购买用户ID
    private BigDecimal price;       // 订单价格
    private Integer state;          // 订单状态 (0-待付款 1-待发货 2-待收货 3-已完成 4-已关闭)
    private Integer orderState;
    private Date createTime;        // 下单时间
    private Date paymentTime;
    private String phone; // 手机号
    private String sourcePlatform;

    // === 非数据库字段，通过JoinTable查询获得 ===
    private String shopName;        // 店铺名称
    private String productName;     // 商品名称
    private String classifyName;
    private String shopNameLike;
    private String productNameLike;
    private Date beginCreateTime;
    private Date endCreateTime;

    public CereShopOrder() {
        this(null);
    }

    public CereShopOrder(String id) {
        super(id);
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public Long getShopId() {
        return shopId;
    }

    public void setShopId(Long shopId) {
        this.shopId = shopId;
    }

    public Long getProductId() {
        return productId;
    }

    public void setProductId(Long productId) {
        this.productId = productId;
    }

    public String getOrderFormid() {
        return orderFormid;
    }

    public void setOrderFormid(String orderFormid) {
        this.orderFormid = orderFormid;
    }

    public Long getBuyerUserId() {
        return buyerUserId;
    }

    public void setBuyerUserId(Long buyerUserId) {
        this.buyerUserId = buyerUserId;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getShopName() {
        return shopName;
    }

    public void setShopName(String shopName) {
        this.shopName = shopName;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public String getClassifyName() {
        return classifyName;
    }

    public void setClassifyName(String classifyName) {
        this.classifyName = classifyName;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getShopNameLike() {
        return shopNameLike;
    }

    public void setShopNameLike(String shopNameLike) {
        this.shopNameLike = shopNameLike;
    }

    public String getProductNameLike() {
        return productNameLike;
    }
    public void setProductNameLike(String productNameLike) {
        this.productNameLike = productNameLike;
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    public Date getBeginCreateTime() {
        return beginCreateTime;
    }
    public void setBeginCreateTime(Date beginCreateTime) {
        this.beginCreateTime = beginCreateTime;
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    public Date getEndCreateTime() {
        return endCreateTime;
    }
    public void setEndCreateTime(Date endCreateTime) {
        this.endCreateTime = endCreateTime;
    }

    public Date getPaymentTime() {
        return paymentTime;
    }
    public void setPaymentTime(Date paymentTime) {
        this.paymentTime = paymentTime;
    }
    public Integer getOrderState() {
        return orderState;
    }
    public void setOrderState(Integer orderState) {
        this.orderState = orderState;
    }
    public String getSourcePlatform() {
        return sourcePlatform;
    }
    public void setSourcePlatform(String sourcePlatform) {
        this.sourcePlatform = sourcePlatform;
    }
}